#ifndef MONITORINGDEVICESQLITE_H
#define MONITORINGDEVICESQLITE_H

#include <QObject>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QDebug>
#include "MonitooringConfig.h"
#include "MonitoringTool.h"
class MonitoringDeviceSqLite : public QObject
{
    Q_OBJECT
public:
    // 获取单例实例的静态方法
    static MonitoringDeviceSqLite& getInstance();

    bool openSqLite(const QString&);
    bool createSqLite(const QString&);
    QueryResult insertData(const QString&,const QString&,const QString&,const QString&,const QString&,const QString&,const QString&);
//    QueryResult isUserExists(const QString&);//查询用户是否存在
//    QueryResult changePassword(const QString&,const QString&);//修改密码
//    QueryResult loginGetData(const QString&,const QString&);//登录
//    QueryResult changeEmail(const QString&,const QString&);//修改邮箱
    bool optionsSqLite();
//    userModel*  getSqLite(const QString&);
    // 禁止拷贝构造函数和赋值运算符
    MonitoringDeviceSqLite(const MonitoringDeviceSqLite&) = delete;
    MonitoringDeviceSqLite& operator=(const MonitoringDeviceSqLite&) = delete;
private:
    QSqlQuery query;
    QSqlDatabase db;
    // 私有析构函数，防止外部删除
    ~MonitoringDeviceSqLite();
    explicit MonitoringDeviceSqLite(QObject *parent = nullptr);

};

#endif // MONITORINGDEVICESQLITE_H
